<template>
	<view>
		<view class="mainpadding ffffff">
			<view class="margin_top2 flexbetween">
				<view class="shilitu">
					<image :src="dataAll.goods_image_text" mode=""></image>
				</view>
				<view class="flexcolumnbet" style="width: 66%;height: 180rpx;">
					<view class="xiaohei titletext fonweight xiankuan">{{dataAll.goods_name}}</view>
					<view class="xiaohui titletext nofonweight">积分抵扣：{{dataAll.score}}</view>
					<view class="xiaohui titletext nofonweight">实付金额：
						<text class="xiaohong titletext fonweight">{{dataAll.pay_price}}</text>
					</view>
					<view class="flexbetween" style="width: 100%">
						<view class="xiaohui titletext nofonweight margin_top1">*1</view>
						<view class="xiaohei titletext nofonweight margin_top1">总价：
							<text class="xiaohong titletext fonweight">{{dataAll.price}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="mainpadding_top flexbetween ffffff strongtext flexcenter" @click="qmShow=true">
			<text style="color: #2979ff;">点击签名</text>
			<u-icon name="arrow-right" color="#2979ff" size="20"></u-icon>
		</view>
		<u-popup :show="qmShow" closeable @close="qmShow=false" round="10">
			<view class="mainpadding ffffff radius">
				<view class="xiaohui" style="font-size: 22rpx;">客户请仔细阅读，签字后代表本人确认无误并同意转拍</view>
				<view style="font-size: 24rpx;color: #333;" class="margin_top2">请签字：</view>
				<view class="sign">
					<csr-sign @finish="finish" ref="csrsign" orientation="portrait" height="300"
						strokeStyle="#333333"></csr-sign>
				</view>
				<view class="xiaohong" style="font-size: 22rpx;">注：签字完成后请点击完成签名！</view>
				<view class="flexright margin_top">
					<view class="xiaohui" style="font-size: 22rpx;">{{httpRequest.returnDate(Number(new Date()))}}
					</view>
				</view>
			</view>
		</u-popup>
		
		<view class="gudingdb ffffff mainpadding">
			<view class="bigbtn" @click="submit()">确认转拍</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				httpRequest,
				listid:"",
				custom_image:"",
				dataAll:{},
				qmShow:false,
			}
		},
		onLoad(options) {
			this.listid = options.id
		},
		onShow() {
			this.init()
		},
		methods: {
			finish(e){
				let _this = this;
				this.qmShow = false
				httpRequest.uploadFile('/api/common/upload', e).then(res => {
					this.custom_image = res.url
				}).catch(err => {
				});
			},
			init(){
				httpRequest.request("/api/cccl/zpSure", 'GET', {
					order_id:this.listid,
				}, false, false, true).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			submit(){
				httpRequest.request("/api/cccl/zpSubmit", 'GET', {
					order_id:this.listid,
					qz_image:this.custom_image,
				}, false, false, true).then(res => {
					httpRequest.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack(1)
						},1000)
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #fafafa;
	}
	.shilitu {
		width: 200rpx;
		height: 160rpx;
	
		image {
			width: 100%;
			height: 100%;
		}
	}
</style>
